package com.wdg.controller;

import com.wdg.fegin.ICookBookFegin;
import com.wdg.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/cookbook_consumer")
public class CookBookController {
    @Autowired
    private ICookBookFegin cookBookFegin;

    @PostMapping("/addCookBook")
    public boolean addCookBook(@RequestBody Cookbook cookbook){

        return cookBookFegin.addCookBook(cookbook);
    }

    //    获得所有的厨具
    @GetMapping("/getAllCbtool")
    public List<Cbtool> getAllCbtool(){
        return cookBookFegin.getAllCbtool();
    }

    //    获得所有的口味
    @GetMapping("/getAllCbtaste")
    public List<Cbtaste> getAllCbtaste(){
        return cookBookFegin.getAllCbtaste();
    }

    //    获得所有难度
    @GetMapping("/getAllCbdifficulty")
    public List<Cbdifficulty> getAllCbdifficulty(){
        return cookBookFegin.getAllCbdifficulty();
    }

    //    获得所有的工艺
    @GetMapping("/getAllcratf")
    public List<Cbcratf> getAllcratf(){
        return cookBookFegin.getAllcratf();
    }

    //    获得所有的耗时
    @GetMapping("/getAllCbtime")
    public List<Cbtime> getAllCbtime(){
        return cookBookFegin.getAllCbtime();
    }
}
